package com.chen.admin.service;


import com.chen.admin.common.Result;
import com.chen.admin.entity.CheckOut;
import com.chen.admin.entity.CheckOutGuestInfo;
import com.chen.admin.mapper.CheckInMapper;
import com.chen.admin.mapper.CheckOutMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CheckOutService {


    @Autowired
    private CheckOutMapper checkOutMapper;
    @Autowired
    private CheckInMapper checkInMapper;


    public Result checkOut(CheckOutGuestInfo checkOutGuestInfo) {


        int count = checkOutMapper.checkOut(checkOutGuestInfo);
        if (count == 0) {
            return Result.error("400", "退房失败");
        }
        return Result.success("退房成功");

    }

    public List<CheckOutGuestInfo> checkOutPageList() {

        List<CheckOutGuestInfo> checkOutGuestInfoList = checkOutMapper.checkOutPageList();
        return checkOutGuestInfoList;
    }
}
